<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>04 JSX小练习</title>
</head>

<body>
    <div id="root"> </div>
</body>

<script src="https://unpkg.com/react@18/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>

<script type="text/babel">

    const data = ['Angular', 'React', 'Vue']

    const VDOM = (
        <div>
            <h1 className="title">前端JS框架列表</h1>
            <ul>
                {data.map((item, index) => (
                    <li key={index}>
                        <h3>序号：{index}</h3>
                        <p>{item}</p>
                    </li>
                ))}
            </ul>
        </div>
    )

    const root = ReactDOM.createRoot(document.getElementById('root'))
    root.render(VDOM)
</script>

</html>